function [IG, ind]=computeTanIG(score_map,num_tan_OR,vol_and_cluster,num_vol_and_cluster)
if isempty(vol_and_cluster)
	vol_and_cluster = ones(score_map,1);
end
% pre-process, make invisible shapes score to 0;
non_num_index = (score_map<=-1e7);
score_map(non_num_index)=0;

if num_tan_OR ==1
    if isempty(vol_and_cluster);
		[IG ind] = max(sum(score_map));
        ind = zeros(size(score_map,1),1,'int32')+ind;
    else
		IG = zeros(num_vol_and_cluster,1);
		ind = zeros(size(score_map,1),1); %% currently for appearance cluster
		for i_vol_and = 1:num_vol_and_cluster
			tmp = find(vol_and_cluster==i_vol_and);
			[score shape_ind]=max(sum(score_map(tmp,:))); 
			ind(tmp)=shape_ind;
			IG(i_vol_and)=score;
		end
    end
else
	disp('error: cases tan_OR number > 1 has not been implemented.')
	IG = 0;
	ind = zeros(size(score_map,1),1);
end
